package fashionshop.gui_old;

import java.awt.BorderLayout;
import java.util.Vector;

import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableModel;

import fashionshop.bll.ImportBLL;
import fashionshop.bll.OrderBLL;

public class ImportUI {

	private JTable importTable;
	Vector importTableTitle;
    Vector importTableRecords;
	
	public ImportUI() throws Exception{
		importTable = new JTable();
		importTableTitle = new Vector();
		importTableRecords = new Vector();
		importTableTitle.add("ID");
		importTableTitle.add("Tên nhân viên");
		importTableTitle.add("Tổng cộng");
		importTableTitle.add("Ngày nhập");
		importTableTitle.add("Ghi chú");
		importTableRecords = ImportBLL.loadAllImport();
		importTable.setModel(new DefaultTableModel(importTableRecords, importTableTitle));
		
	}
	
	public void loadAllImport(){
		MainScreen.tablePanel.removeAll();
		MainScreen.tablePanel.setLayout(new BorderLayout());
		MainScreen.tablePanel.add(new JScrollPane(importTable), BorderLayout.CENTER);
		MainScreen.tablePanel.revalidate();
	}
}
